#include<bits/stdc++.h>
using namespace std;
#define int long long
namespace IO
{
	template<typename T>
	void read(T &_x){_x=0;int _f=1;char ch=getchar();while(!isdigit(ch)) _f=(ch=='-'?-1:_f),ch=getchar();while(isdigit(ch)) _x=_x*10+(ch^48),ch=getchar();_x*=_f;}
	template<typename T,typename... Args>
	void read(T &_x,Args&...others){Read(_x);Read(others...);}
	const int BUF=20000000;char buf[BUF],to,stk[32];int plen;
	#define pc(x) buf[plen++]=x
	#define flush(); fwrite(buf,1,plen,stdout),plen=0;
	template<typename T>inline void print(T x){if(!x){pc(48);return;}if(x<0) x=-x,pc('-');for(;x;x/=10) stk[++to]=48+x%10;while(to) pc(stk[to--]);}
}
using namespace IO;
const int N = 1e6+10;
vector<int>v[N];
int n,m,ans,o;
char c;
signed main()
{
	freopen("indian.in","r",stdin);
	freopen("indian.out","w",stdout);
	read(n),read(m);
	for(int i = 1;i <= n;i++)
	{
		v[i].push_back(0);
		for(int j = 1;j <= m;j++)
		{
			cin >> c;
			if(c == '#') v[i].push_back(1);
			else v[i].push_back(0),o = 1;
		}
	}
	for(int i = 1;i <= n;i++,pc('\n'))
		for(int j = 1;j <= m;j++)
			if(v[i][j] == 0) pc('.');
			else pc('1');
	flush();
	return 0;
}

